import csv, sys

#print sys.argv[2],'\n',

matrixreader = csv.reader(open(sys.argv[1], 'r'), delimiter='\t')
matrixwriter = csv.writer(open(sys.argv[2], 'w'), delimiter='\t')

rows = []

for row in matrixreader:
    rows.append(row)
    
nrows = len(rows)
ncols = len(rows[0])

#print nrows,ncols,'\n',

for colidx in xrange(0,ncols):
    matrixwriter.writerow([row[colidx] for row in rows])
                
